import React, { Component } from 'react'
import { Tabs } from 'antd';
import {connect} from "react-redux"
import {bindActionCreators} from "redux"
import * as action from "../action"
const { TabPane } = Tabs
function callback(key) {
    console.log(key);
}

class Classman extends Component {
    componentDidMount(){
        this.props.getList()
    }
    render() {
        return (
            <div>
               <Tabs defaultActiveKey="1" onChange={callback}>
                {
                    this.props.arr&&this.props.arr.length?this.props.arr.map((item,index)=>{
                        return <TabPane tab={item.title} key={item.key}>
                                  {
                                      item.con
                                  }
                             </TabPane>
                    }):""
                }
                </Tabs>
            </div>
        )
    }
}
let mapStateToprops = (state)=>{
    return {
        ...state.pcreducer
    }
}
let mapDisPactchTopROPS = (dispatch)=>bindActionCreators(action,dispatch)
export default connect(mapStateToprops,mapDisPactchTopROPS)(Classman)
